# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: dhead666 <myfoolishgames@gmail.com>

pkgname=tinyxml2
pkgver=9.0.0
pkgrel=1
pkgdesc='Simple XML parser made for easy integration'
arch=('loong64' 'x86_64')
url='http://www.grinninglizard.com/tinyxml2'
license=('zlib')
makedepends=('cmake' 'ninja' 'setconf')
source=(https://github.com/leethomason/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('cc2f1417c308b1f6acc54f88eb70771a0bf65f76282ce5c40e54cfe52952702c')

prepare() {
  grep License -A20 "$pkgname-$pkgver/readme.md" > LICENSE
}

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -Dtinyxml2_SHARED_LIBS=ON
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# getver: github.com/leethomason/tinyxml2
# vim: ts=2 sw=2 et:
